drm/vc4: Fix OOPSes from trying to cache a partially constructed BO.
authorEric Anholt <eric@anholt.net>
Thu, 9 Feb 2017 17:23:34 +0000 (09:23 -0800)
committerRaspbian kernel package updater <root@raspbian.org>
Thu, 9 Mar 2017 17:52:49 +0000 (17:52 +0000)
commit371b19cf9322eb7bfe37815aee836fb767168622
tree6c473c2e708e3c56ed899cdb36c9295e8a9ed7d6
parent4a74fd401ba99fafa90e867fe6a7b8bac158b73e
drm/vc4: Fix OOPSes from trying to cache a partially constructed BO.

If a CMA allocation failed, the partially constructed BO would be
unreferenced through the normal path, and we might choose to put it in
the BO cache.  If we then reused it before it expired from the cache,
the kernel would OOPS.

Signed-off-by: Eric Anholt <eric@anholt.net>
Fixes: c826a6e10644 ("drm/vc4: Add a BO cache.")
drivers/gpu/drm/vc4/vc4_bo.c